#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Author  : lkm

""" 数据以列表的形式传入 """

# x = [533.8, 574.6, 606.9, 649.8, 705.1, 772.0, 816.4, 892.7, 963.9, 1015.1, 1102.7]

def prefict_y(T, N):
    y_sum = 0
    for i in range(T-N, T):
        y_sum += x[i]
    return y_sum / N

def Standard_Error(N):
    S0 = 0
    for i in range(N-1, len(x)):
        S0 += (prefict_y(i, N) - x[i]) ** 2
    s_error = (S0 / (len(x) - 4)) ** 0.5
    return s_error












